﻿define(function(require,exports,module) {
	var myPub = require('./public');

    var vipDrawBtn = $('.js_vip_draw');
    var birthdayDrawBtn = $('.js_birthday_draw');
    var immediatelyShoppingBtn = $('.js_immediately_shopping_btn');//立即选购
    module.exports = {
        init: function(data,names) {

        }
    };

    //领取会员专享礼包
    vipDrawBtn.on('click', function (e) {
        G_JSON_GET('/coupon/drawVipMonthGiftPackage', {}, function (data) {
            if (data.status == "success") {
                myPub.TipLayerEnd("领取成功！","no",function () {
                    window.location.href=window.location.href+"?id="+10000*Math.random();
                });

            } else {
                myPub.TipLayer(data.message);
            }
        });
    });

    // 领取生日礼包
    birthdayDrawBtn.on('click', function (e) {
        G_JSON_GET('/coupon/drawBirthdayGiftPackage', {}, function (data) {
            if (data.status == "success") {
                myPub.TipLayerEnd("领取成功！","no",function () {
                    window.location.href=window.location.href+"?id="+10000*Math.random();
                });
            } else {
                myPub.TipLayer(data.message);
            }
        });
    });

    // 点击跳转超级会员日活动页
    immediatelyShoppingBtn.on('click', function (e) {
        /*if(growValue!=undefined&&growValue<GOLD){
            myPub.askLayer("亲爱用户该优惠专区只有黄金以上等级的会员才可优惠购买，您当前为"+memberLevel+"等级请继续努力哦。",function () {
                window.location.href= "/myInfo/toMemberSuperDay";
            },function () {
            },"no",function () {

            },['浏览商品','取消']);
        }else{*/
            window.location.href= "/myInfo/toMemberSuperDay";
        // }
    });

});



